<?php
/**
 * Created by Zhoujinda.
 * User: Gooraye
 * Date: 2016/3/4
 * Time: 14:47
 */
namespace Test\Controller;

use Admin\Api\FreightTemplateApi;
use Admin\Model\FreightTemplateModel;

class TestFreightTemplateController extends TestController{

    public function add(){

        echo "TestFreightTemplate";


        $data = array();
        $data['name'] = 'testTemplate';
        $data['type'] = '1';
        $data['company'] = '6006';
        $data['uid'] = 1;
        $data['freightAddress'] = array(
            array(
                'addressids'=>0,
                'addresses'=>'全国 [默认运费]',
                'firstpiece'=>1,
                'firstmoney'=>1,
                'replenishpiece'=>1,
                'replenishmoney'=>1
            ),
        );

        $result = apiCall(FreightTemplateApi::ADD_TEMPLATE,array($data));

        dump($result);

    }

    public function delete(){

        $id = I('id');

        if($id!=0){
            $result = apiCall(FreightTemplateApi::DELETE_TEMPLATE,array(array('id'=>$id)));
            dump($result);
        }else{
            echo "运费模版id缺失";
        }


    }

}